package com.diver.flinkdemo.entity.xxt;


/**
 * Created by wenjun on 2018/6/20.
 */
public class ApiResult {
    /**
     * 成功状态码200
     */
    public static final int SUCCESS_CODE = 200;
    /**
     * 系统异常状态码500
     */
    public static final int SYSTEM_ERROR_CODE = 500;
    /**
     * 用户为登录401
     */
    public static final int USER_UNLOGIN_CODE = 401;

    /**
     * 数据为空 99
     */
    public static final int EMPTY_DATA_CODE = 99;
    /**
     * 参数错误状态码100
     */
    public static final int PARAM_ERROR_CODE = 100;
    /**
     * 业务错误状态码101
     */
    public static final int BUSINESS_ERROR_CODE = 101;

    /**
     * 业务状态码201
     */
    public static final int BUSINESS_SUCCESS_CODE1 = 201;

    /**
     * 业务状态码202
     */
    public static final int BUSINESS_SUCCESS_CODE2 = 202;
    /**
     * 业务状态码203
     */
    public static final int BUSINESS_SUCCESS_CODE3 = 203;

    /**
     * 业务状态码204
     */
    public static final int BUSINESS_SUCCESS_CODE4 = 204;

    /**
     * 第三方应用状态码
     */
    public static final int TRD_ERROR_CODE = 102;

    /**
     * 成功状态码200
     */
    public static final int NO_2D_CODE = 468;

    /**
     * 成功状态码200
     */
    public static final int IS_NOT_ONLINE_CODE = 469;

    /**
     * 成功状态码200
     */
    public static final int FAILED_SAVE_CODE = 420;

    /**
     * 返回代码
     */
    private Integer code;

    /**
     * 返回信息
     */
    private String msg;

    /**
     * 成功标识
     */
    private boolean success = true;

    /**
     * 返回数据
     */
    private Object result;

    /**
     * 返回总数
     */
    private int rows;

    /**
     * 请求时间
     */
    private long time;

    private ApiResult() {
    }

    public static ApiResult newInstance() {
        return new ApiResult();
    }

    public Integer getCode() {

        return code;
    }


    public void setCode(Integer code) {

        this.code = code;
    }

    public String getMsg() {

        return msg;
    }

    public void setMsg(String msg) {

        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }
}
